class SubtasksdescController < ApplicationController
before_filter :authorize
    layout "websitesinfo"
  active_scaffold :subtasksdesc do | config |  
    config.label = "Subtasks Information"

config.show.link.type = :record
config.show.link.inline = true
  config.show.link.position = :after 
  	  config.columns = [:name,:conturl1,:uname1,:upwd1,:searterm1,:descocont1,:commocont1,:last_accessed_at,:last_accessed_user,:last_updated_at,:last_updated_user]	
		 config.columns[:conturl1].label ="Content URL"
		 config.columns[:uname1].label ="User Name" 
		 config.columns[:upwd1].label ="User Password"
		 config.columns[:searterm1].label ="Search term" 		 
		 config.columns[:descocont1].label ="Description of content"
		 config.columns[:commocont1].label ="Comment" 	
		 config.columns[:conturl1].set_link "link_action",:popup=>true	

    config.columns[:descocont1].form_ui = :textarea
    config.columns[:descocont1].options = {:rows => 90, :cols => 150}			

    config.columns[:commocont1].form_ui = :textarea
    config.columns[:commocont1].options = {:rows => 90, :cols => 150}	    
     
  config.list.columns.exclude :searterm1,:descocont1,:commocont1			 
		 
    config.create.columns.exclude(:searterm1,:descocont1,:commocont1,:last_accessed_at,:last_accessed_user,:last_updated_at,:last_updated_user)  
    config.create.columns.add_subgroup "Subtasks Detail Information"  do |group|       
       	group.add(:searterm1,:descocont1,:commocont1) 
       	end       
       	
    config.update.columns.exclude(:searterm1,:descocont1,:commocont1,:last_accessed_at,:last_accessed_user,:last_updated_at,:last_updated_user)  
    config.update.columns.add_subgroup "Subtasks Detail Information"  do |group|       
       	group.add(:searterm1,:descocont1,:commocont1) 
       	end         	
       	
     config.show.columns.exclude(:name,:conturl1,:uname1,:upwd1)       	
  config.show.label = "Show Subtask Detail"
  

     		 	
  end 
  def link_action
     @crecord = Subtasksdesc.find(params[:id])
     redirect_to @crecord.conturl1 
   end
  def show
  super

    @subtasksdesc = Subtasksdesc.find(params[:id])
    @subtasksdesc.last_accessed_user = User.find(session[:user_id]).name + " action show"
    @subtasksdesc.last_accessed_at = Time.now
    @subtasksdesc.save

  end  
  
  def update

  super

    @subtasksdesc = Subtasksdesc.find(params[:id])
    @subtasksdesc.last_updated_user = User.find(session[:user_id]).name + " action update"
    @subtasksdesc.last_updated_at = Time.now
    @subtasksdesc.save

  end  
  
  def do_edit
  super

    @subtasksdesc = Subtasksdesc.find(params[:id])
    @subtasksdesc.last_accessed_user = User.find(session[:user_id]).name + " action edit"
    @subtasksdesc.last_accessed_at = Time.now
    @subtasksdesc.save

  end 
  
  
end

